package com.along;

import com.along.aop.service.UserService;
import com.along.config.App1Properties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.scheduling.annotation.EnableScheduling;

/*
 * @Author: liujinyi
 * @DateTime: 2025/1/13 15:04
 */
@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})
//@ComponentScan(basePackages = { "com.along" }, includeFilters = @ComponentScan.Filter(type = FilterType.ANNOTATION, classes = {
//        Controller.class, ControllerAdvice.class }))
// config配置实体类 用于注册spring 标识
@EnableConfigurationProperties(App1Properties.class)
// 启用定时任务支持
@EnableScheduling
public class DemoApplication implements CommandLineRunner {

    @Autowired
    UserService userService;
    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        userService.addUser("Alice");
        userService.deleteUser("Bob");
    }
}
